﻿namespace DatabaseDoc.Library
{
    using System.Collections.Generic;
    using System.ComponentModel.Composition;

    /// <summary>
    /// Database connector
    /// </summary>
    [InheritedExport]
    public interface IDatabaseConnector
    {
        /// <summary>
        /// Gets the key.
        /// </summary>
        /// <value>The key.</value>
        string Key { get;  }

        /// <summary>
        /// Populates a database document type.
        /// </summary>
        /// <param name="serverNames">The server names.</param>
        /// <param name="databaseName">Name of the database.</param>
        /// <param name="tableName">Name of the table.</param>
        /// <returns>The database document type</returns>
        DatabaseDoc Populate(string[] serverNames, string databaseName, string tableName);

        bool DatabaseExists(string serverName, string databaseName);

        void CreateDatabase(string serverName, string databaseName);

        void DropDatabase(string serverName, string databaseName);

        void RunScripts(string serverName, string databaseName, IEnumerable<string> scripts);

        void GenerateScripts(string serverName, string databaseName, string tableName, string scriptPrefix);
    }
}